<!DOCTYPE html>
<html>
    <head>
        <title>登录</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="__ROOT__/static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <link href="__ROOT__/static/index/css/home.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <div class="home_login">
            <div class='header'style='border: none;'>
                <div class="w1200">
                    <a class="logo" href="__ROOT__"><img src="__ROOT__/static/index/image/logonew.png" alt=""/></a>
                    <span class='title'>登录</span>
                    <span class="link">
                        <a href="#">建工网首页</a>
                        <a href="#">帮助中心</a>
                        <a href="#">联系我们</a>
                    </span>
                </div>
            </div>
            <div class="main">
                <div class='w1200'>
                    <div class="login-img">
                        <img src="__ROOT__/static/index/image/blue.jpg" alt=""/>
                    </div>
                    <div class="login-box">
                        <form>
                            <input type="hidden" name="type" value="1"/>
                            <div class="box-header">
                                <span class="current" data-type="1">个人登录</span><span data-type="2">企业登录</span>
                            </div>
                            <ul class="box-body">
                                <li><i class="icon icon-zh"></i><input class='it' type="text" name="account" placeholder="手机号码/邮箱" value="18107772367"/></li>
                                <li><i class="icon icon-mm"></i><input class='it' type="password" name="password" placeholder="密码" value="123456" /></li>
                                <li><button type="button" id="btn_submit">登录</button></li>
                                <!--                                <li>
                                                                    <p class='font12'>你也可以使用以下帐号登录</p>
                                                                    <a class='icon icon-QQ'></a>
                                                                    <a class='icon icon-xl'></a>
                                                                </li>-->
                                <li class='sm'>
                                    <a class='link'>忘记密码？</a>
                                    |
                                    <a class='link' href="{:U('index/account/register')}">注册</a>
                                    |
                                    <a class='link'>关于帐号</a>
                                </li>
                            </ul>
                        </form>
                    </div>
                </div>
            </div>
            <div class="footer">
                <div class="w1200">
                    <p>
                        <span><a href="#">公司简介</a></span>
                        |
                        <span><a href="#">联系方式</a></span>
                        |
                        <span><a href="#">招聘信息</a></span>
                        |
                        <span><a href="#">客户服务</a></span>
                        |
                        <span><a href="#">相关法律</a></span>
                        |
                        <span><a href="#">网络营销</a></span>
                        |
                        <span><a href="#">公司简介</a></span>

                    </p>
                    <p>版权所有 ©2015-2016</p>
                </div>
            </div>
        </div>
        <script src="__ROOT__/static/index/js/jquery-1.12.0.min.js" type="text/javascript"></script>
        <script src="__ROOT__/static/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="__ROOT__/static/comm/ksbox/ksbox-bootstrap.js" type="text/javascript"></script>
    </body>
</html>
<script>
    $(function () {
        $(".box-header span").on("click", function () {
            var type = $(this).attr('data-type');
            $("input[name='type']").val(type);
            if (!$(this).hasClass("current")) {
                $(this).addClass("current").siblings().removeClass("current");
            }
        });

        //登录事件
        $('#btn_submit').on('click', function () {
            var url = "{:U('account/login_action')}";
            var data = $(this).parents('form').serializeArray();
            $.getJSON(url, data, function (json) {
                if (json.flag) {
                    location.href = json.url;
                } else {
                    $.ksbox.alert({
                        msg: json.error
                    });
                }
            })
        })
    });


</script>